
#include <Gizmo.h>

Gizmo::Gizmo(float length)
{
	transform = new Transform();
	mVertices = new Vertex[6];
	mVertices[0].Set(255,   0,   0, 0,  0.0f, 0.0f, 0.0f);
	mVertices[1].Set(255,   0,   0, 0,  length, 0.0f, 0.0f);

	mVertices[2].Set(0,   255,   0, 0,  0.0f, 0.0f, 0.0f);
	mVertices[3].Set(0,   255,   0, 0,  0.0f, length, 0.0f);

	mVertices[4].Set(0,   0,   255, 255,  0.0f, 0.0f, 0.0f);
	mVertices[5].Set(0,   0,   255, 255,  0.0f, 0.0f, length);
}

void Gizmo::DrawGizmo()
{
	glInterleavedArrays( GL_C4UB_V3F, 0, mVertices );
	glDrawArrays( GL_LINES, 0, 6 );
}

Gizmo::~Gizmo()
{
	delete transform;
	delete[] mVertices;
}

